<?php
namespace serv\papi;
use of;

class Currency
{
    //http://ec.com/serv/?c=Currency&a=index
    public static function index()
    {
        try {
            $data = file_get_contents('php://input');
            if (empty($data)) {
                of::work(401, '参数不能为空');
            }
            $params['data'] = json_decode($data, true);
            \serv\queue\system\currency::syncRate($params);
            echo json_encode(['code' => 200, 'message' => 'Successful', 'data' => []]);
        } catch (\Exception $e) {
            echo of::work($e);
        }
    }
}